	package com.rm2pt.generator.springboot.LabManage.entity;
	
	import org.hibernate.annotations.Fetch;
	import org.hibernate.annotations.FetchMode;
	import com.fasterxml.jackson.annotation.JsonBackReference;
	import com.fasterxml.jackson.annotation.JsonIgnore;
	import javax.persistence.FetchType;
	import java.util.ArrayList;
	import javax.persistence.OneToMany;
	import javax.persistence.OneToOne;
	import javax.persistence.CascadeType;
	import java.util.Date;
	import java.util.List;
	import java.io.Serializable;
	import javax.persistence.Entity;
	import javax.persistence.Transient;
	import javax.persistence.GeneratedValue;
	import javax.persistence.GenerationType;
	import javax.persistence.Id;
	import javax.persistence.JoinColumn;
	import javax.persistence.ManyToOne;
	import com.fasterxml.jackson.annotation.ObjectIdGenerators;
	import com.fasterxml.jackson.annotation.JsonIdentityInfo;
	
	@Entity
	public class Teacher extends User {
		
		/* all primary attributes */
		private String introduce;
		public String getIntroduce() {
			return introduce;
		}
		public void setIntroduce(String Introduce) {
			this.introduce = Introduce;
		}	
			

		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER,mappedBy="teamBelongTeacher")
				private List<Team> teacherOwnTeam = new ArrayList<Team>();
					
		public List<Team> getTeacherOwnTeam() {
			return teacherOwnTeam;
		}
				
		public void setTeacherOwnTeam(List<Team> TeacherOwnTeam) {
			this.teacherOwnTeam = TeacherOwnTeam;
		}
		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER,mappedBy="dailytoTeacher")
				private List<Daily> teacherHandleDaily = new ArrayList<Daily>();
					
		public List<Daily> getTeacherHandleDaily() {
			return teacherHandleDaily;
		}
				
		public void setTeacherHandleDaily(List<Daily> TeacherHandleDaily) {
			this.teacherHandleDaily = TeacherHandleDaily;
		}
		
		@JsonIgnore
		@Fetch(FetchMode.SUBSELECT)
		@OneToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST},fetch=FetchType.EAGER,mappedBy="plantoTeacher")
				private List<Plan> teacherHandlePlan = new ArrayList<Plan>();
					
		public List<Plan> getTeacherHandlePlan() {
			return teacherHandlePlan;
		}
				
		public void setTeacherHandlePlan(List<Plan> TeacherHandlePlan) {
			this.teacherHandlePlan = TeacherHandlePlan;
		}
		
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Teacher other = (Teacher) obj;
			if (!this.getRealid().equals(other.getRealid()))
				return false;
			else
				return true;
		}
	}
